phillipabatzfandomcom-20200214-history
Bitcoin Savings
1. Introduction Bitcoin transactions are relatively secure, convenient, and make meeting face-to-face in a safe and secure physical location unnecessary for a wide variety of transactions, but holding bitcoins for an extended period of time presents risks unique to this currency. If Bitcoins or similar blockchain currencies are going to have all the value that people intuitively expect of a currency, certain considerations should be addressed. Bitcoin “mining” only serves to verify new transactions, while transactions that have already been verified lie dormant, unattended, unexamined, and unsecured. '''The best design of a bitcoin wallet would include resuming connection to the network at regular or irregular intervals, and conducting transactions between two or more accounts, owned by the same party, at reasonable intervals. The network is designed specifically to disallow double-spending, so the possibility of a single party abusing such “self-transactions” would seem remote. Simultaneously, any attacker accessing the wallet itself would have to be capable of '''falsifying a recorded transaction, or their efforts mean exactly nothing. The proper network participant behaviors, within the positive control of each concerned party, individually, is equal to, or of greater importance than, the design of the network specifications. Do the problems of public convention and central authority seem to return, in the nature of network participant behaviors, rather than network or currency specifications? ''' '''As the saver of a bitcoin, I must be assured that the previous block-chains, which affirm that those bitcoins are “mine” and not “someone else’s”, are not inadvertently or purposefully over-written by subsequent and illegitimate transactions. The latter such event would very much resemble the “double-spending” event, forming an elegant symmetry. Either such event can be prevented by an up-to-the-minute block-chain, while neither can be prevented without the network consistently verifying the transactions. All forms of encryption, including “hashes” generally, and the following hashes in particular, are meant to be secure from illicit decryption for a limited time, depending firstly on the quality and quantity of labor expended to form a secure encryption, and secondly, on the quality and quantity of labor expended upon the illicit decryption. The balance of currency displayed by your wallet only represents the last known state of the network and your relationship to that network at that time.'' '' Your wallet cannot secure your transactions and balance in any meaningful way, except to hold the last known hash of bitcoins for your use in a later transaction. No bitcoin hash is forever, '''and '''the larger the gain to be had '''in a successful effort at illicit decryption, the greater the effort that will be applied to obtain it. Note that '''an attacker has the choice of over-writing someone else’s real transactions, or their own previous transactions (double-spending, triple-spending...), based on the gain to be had in the effort. Many of the best practices outlined in the Satoshi document are not actually used by real participants in the Bitcoin network, and they not only place their own transactions at risk, but the transactions of other parties as well. ''' 2. Signature Hash We define an electronic coin as a chain of digital signatures. Each owner transfers the coin to the next by digitally signing a hash of the previous transaction and the public key of the next owner and adding these to the end of the coin. A payee can verify the signatures to verify the chain of ownership. The problem of course is the payee can't verify that one of the owners did not double-spend the coin. For our purposes, the earliest transaction is the one that counts, ''so we don’t care about later attempts to double-spend. (?!?)'' The only way to confirm the absence of a transaction is to be dynamically aware of all transactions. 'To accomplish this without a trusted party, transactions must be publicly announced, and we need a system for participants to agree on a single history of the order in which they were received. The payee needs proof that at the time of each transaction, the majority of nodes agreed it was the first received. 'the majority of nodes agree that “your” bitcoins were actually involved in a later transaction, and the evidence of the transaction in which you received “your” bitcoins is absent, those bitcoins are no longer “yours”, they are “someone else’s”: they are no longer the property of “you”, they are the property of some “not-you”. 3. Timestamp Hash The solution we propose begins with a timestamp server. A timestamp server works by taking a hash of a block of items to be time-stamped and widely publishing the hash, such as in a newspaper or Usenet post. '''The timestamp proves that the data must have existed at the time, obviously, in order to get into the hash. Each timestamp includes the previous timestamp in its hash, forming a chain, with each additional timestamp reinforcing the ones before it. ''' 4. Proof-of-Work The proof-of-work also solves the problem of determining representation in majority decision making. If the majority were based on '''one-IP-address-one-vote, it could be subverted by anyone able to allocate many IPs. Proof-of-work is essentially one-CPU-one-vote. is this specification implemented, and how secure is it? The majority decision is represented by the longest chain, which has the greatest proof-of-work effort invested in it. If a majority of CPU power is controlled by honest nodes, the honest chain will grow the fastest and outpace any competing chains. To modify a past block, an attacker would have to redo the proof-of-work of the block and all blocks after it and then catch up with and surpass the work of the honest nodes. We will show later that the probability of a slower attacker catching up diminishes exponentially as subsequent blocks are added. '' 5. Network The steps to run the network are as follows: 1) 'New transactions are broadcast to all nodes.' 2) Each node collects new transactions into a block. 3) Each node works on finding a difficult proof-of-work for its block. 4) When a node finds a proof-of-work, it broadcasts the block to all nodes. 5) '''Nodes accept the block only if all transactions in it are valid and not already spent.' 6) Nodes express their acceptance of the block by working on creating the next block in the chain, using the hash of the accepted block as the previous hash. 6. Incentive The incentive can also be funded with transaction fees. If the output value of a transaction is less than its input value, the difference is a transaction fee that is added to the incentive value of the block containing the transaction. Once a predetermined number of coins have entered circulation, the incentive can transition entirely to transaction fees and be completely inflation free. The incentive may help encourage nodes to stay honest. If a greedy attacker is able to assemble more CPU power than all the honest nodes, he would have to choose between using it to defraud people by stealing back his payments, or using it to generate new coins. (?!? As the mining of new bitcoins has reached an exponential cost in processing time, the gains of honesty diminish relative to the gains of decryption.) ' He ought to find it more profitable to play by the rules, such rules that favour him with more new coins than everyone else combined, than to undermine the system and the validity of his own wealth. 7. Reclaiming Disk Space Once the latest transaction in a coin is buried under enough blocks, the spent transactions before it can be discarded to save disk space. To facilitate this without breaking the block’s hash, transactions are hashed in a Merkle Tree 725, with only the root included in the block’s hash. Old blocks can then be compacted by stubbing off branches of the tree. The interior hashes do not need to be stored. A block header with no transactions would be about 80 bytes. If we suppose blocks are generated every 10 minutes, 80 bytes * 6 * 24 * 365 = 4.2MB per year. With computer systems typically selling with 2GB of RAM as of 2008, and Moore’s Law predicting current growth of 1.2GB per year, storage should not be a problem even if the block headers must be kept in memory. '''Are the hashes secure enough? Can a good hash be substituted with a counterfeit hash? What costs in memory and storage should be paid in terms of block-chain security? ' 8. Simplified Payment Verification It is possible to verify payments without running a full network node. A user only needs to keep a copy of the block headers of the longest proof-of-work chain, which he can get by querying network nodes until he’s convinced he has the longest chain, and obtain the Merkle branch linking the transaction to the block it's time-stamped in. He can’t check the transaction for himself, but by linking it to a place in the chain, he can see that a network node has accepted it, and blocks added after it further confirm the network has accepted it. As such, '''the verification is reliable as long as honest nodes control the network block-chain, but is more vulnerable if the network is overpowered by an attacker. While network nodes can verify transactions for themselves, the simplified method can be fooled by an attacker’s fabricated transactions for as long as the attacker can continue to overpower the network. One strategy to protect against this would be to accept alerts from network nodes when they detect an invalid block, prompting the user’s software to download the full block and alerted transactions to confirm the inconsistency. Businesses individuals that receive frequent payments will probably still want to run their own nodes for more independent security and quicker verification. may likely wish to do the same as well. 9. Combining and Splitting Value Although it would be possible to handle coins individually, it would be unwieldy to make a separate transaction for every cent in a transfer. To allow value to be split and combined, transactions contain multiple inputs and outputs. Normally there will be either a single input from a larger previous transaction or multiple inputs combining smaller amounts, and at most two outputs: one for the payment, and one returning the change, if any, back to the sender. It should be noted that fan-out, where a transaction depends on several transactions, and those transactions depend on many more, is not a problem here. There is never the need to extract a complete standalone copy of a transaction’s history. 10. Privacy The traditional banking model achieves a level of privacy by limiting access to information to the parties involved and the trusted third party. The necessity to announce all transactions publicly precludes this method, but privacy can still be maintained by breaking the flow of information in another place: by keeping public keys anonymous. The public can see that someone is sending an amount to someone else, but without information linking the transaction to anyone. This is similar to the level of information released by stock exchanges, where the time and size of individual trades, the “tape”, is made public, but without telling who the parties were. As an additional firewall, a new key pair should be used for each transaction to keep them from being linked to a common owner. ' '''Some linking is still unavoidable with multi-input transactions, which necessarily reveal that their inputs were owned by the same owner. ' 'The risk is that if the owner of a key is revealed, linking could reveal other transactions that belonged to the same owner. ' 11. Calculations We consider the scenario of an attacker trying to generate an alternate chain faster than the honest chain. Even if this is accomplished, it does not throw the system open to arbitrary changes, such as creating value out of thin air or taking money that never belonged to the attacker. Nodes are not going to accept an invalid transaction as payment, and honest nodes will never accept a block containing them. '''An attacker can only try to change one of his own transactions to take back money he recently spent. pointed out above that this is true of dynamic transactions, but that older transactions, or transactions that have other risk factors, are more vulnerable than these assumptions allow for. The race between the honest chain and an attacker chain can be characterized as a Binomial Random Walk. The success event is the honest chain being extended by one block, increasing its lead by +1, and the failure event is the attacker’s chain being extended by one block, reducing the gap by -1. The probability of an attacker catching up from a given deficit is analogous to a Gambler’s Ruin problem. Suppose a gambler with unlimited credit starts at a deficit and plays potentially an infinite number of trials to try to reach break-even. We can calculate the probability he ever reaches break-even, or that an attacker ever catches up with the honest chain, as follows: p = probability an honest node finds the next block q = probability the attacker finds the next block qz = probability the attacker will ever catch up from z blocks behind qz={ 1 if p≤q q/ p z if pq} Given our assumption that p > q, the probability drops exponentially as the number of blocks the attacker has to catch up with increases. With the odds against him, if he doesn’t make a lucky lunge forward early on, his chances become vanishingly small as he falls further behind. ''' We now consider how long the recipient of a new transaction needs to wait before being sufficiently certain the sender can’t change the transaction. We assume the sender is an attacker who wants to make the recipient believe he paid him for a while, then switch it to pay back to himself after some time has passed. The receiver will be alerted when that happens, but the sender hopes it will be too late. The receiver '''generates a new key pair and gives the public key to the sender shortly before signing. This prevents the sender from preparing a chain of blocks ahead of time by working on it continuously until he is lucky enough to get far enough ahead, then executing the transaction at that moment. Once the transaction is sent, the dishonest sender starts working in secret on a parallel chain containing an alternate version of his transaction. The recipient waits until the transaction has been added to a block and z blocks have been linked after it. ' '[Even if the recipient trusts the sender, waiting for additional blocks to be generated may help to preclude attacks by a third party.] ''' He doesn’t know the exact amount of progress the attacker has made, but assuming the honest blocks took the average expected time per block, the attacker’s potential progress will be a Poisson distribution with expected value: =z q p To get the probability the attacker could still catch up now, we multiply the Poisson density for each amount of progress he could have made by the probability he could catch up from that point: ∑ k=0 ∞  k e − k! ⋅{ q/ p z−k  if k≤z 1 if kz} Rearranging to avoid summing the infinite tail of the distribution... 1−∑ k=0 z  k e − k! 1−q/ p z−k   Running some results, we can see the probability drop off exponentially with z. 12. Conclusion We have proposed a system for electronic transactions without relying on trust. We started with the usual framework of coins made from digital signatures, which provides strong control of ownership, but is incomplete without a way to prevent double-spending. To solve this, we proposed a peer-to-peer network using proof-of-work to record a public history of transactions that quickly becomes computationally impractical for an attacker to change if honest nodes control a majority of CPU power. The network is robust in its unstructured simplicity. Nodes work all at once with little coordination. They do not need to be identified, since messages are not routed to any particular place and only need to be delivered on a best effort basis. Nodes can leave and rejoin the network at will, accepting the proof-of-work chain as proof of what happened while they were gone. They vote with their CPU power, expressing their acceptance of valid blocks by working on extending them and rejecting invalid blocks by refusing to work on them. '''Any needed rules and incentives can be enforced with this ''consensus '''mechanism. ' Category:Bitcoin